<template>
    <div class="index">
        <div class="header" v-if="this.lista.table1">
            <div class="da">
                <p>今日实时数据</p>
                <p>
                    <span>{{ this.lista.table1[0].updatetime }}</span>
                    <span>更新</span>
                </p>
            </div>
            <div class="db">
                <p>总票房 <i class="el-icon-caret-right"></i></p>
                <p>
                    <span>{{ this.lista.table0[0].BoxOffice }}</span>
                    <span>环比</span>
                    <span>{{ this.lista.table0[0].BoxOfficeMoM }}%</span>
                </p>
            </div>
            <div class="db">
                <p>总人次 <i class="el-icon-caret-right"></i></p>
                <p>
                    <span>{{ this.lista.table0[0].AudienceCount }}</span>
                    <span>环比</span>
                    <span>{{ this.lista.table0[0].AudienceCountMoM }}%</span>
                </p>
            </div>
            <div class="db">
                <p>总场次 <i class="el-icon-caret-right"></i></p>
                <p>
                    <span>{{ this.lista.table0[0].ShowCount }}</span>
                    <span>环比</span>
                    <span>{{ this.lista.table0[0].ShowCountMoM }}%</span>
                </p>
            </div>
            <div class="db">
                <p>上坐率 <i class="el-icon-caret-right"></i></p>
                <p>
                    <span>{{ this.lista.table0[0].Attendance }}%</span>
                    <span>环比</span>
                    <span>{{ this.lista.table0[0].AttendanceMoM }}%</span>
                </p>
            </div>
        </div>
        <el-container class="container">
            <div class="content"></div>
            <div class="content"></div>
            <div class="content"></div>
            <div class="content"></div>
        </el-container>
    </div>
</template>

<script>
import { GetIndexa } from '@/api/index.js';
export default {
    data() {
        return {
            lista: {},
        }
    },
    created() {
        GetIndexa()
            .then(res => {
                console.log("indexa", res.data);
                this.lista = res.data.data;
            })
            .catch(err => {
                console.log(err);
            })
    }
}
</script>

<style scoped>
.header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 1px 12px rgb(112 48 160 / 12%);
    border-radius: 4px;
    padding: 20px;
    color: #454555;
}

.header .da {
    flex: 0.5 1 0%;
}

.header .da p:nth-of-type(1) {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
}

.header .da p:nth-of-type(2) {
    font-size: 12px;
    color: #7030a0;
}

.header .db {
    flex: 1;
    border-left: 1px solid #edf1f6;
    line-height: 20px;
    padding-left: 20px;
    box-sizing: border-box;
}

.header .db p:nth-of-type(1) {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.header .db p:nth-of-type(2) span:nth-of-type(1) {
    margin-right: 8px;
    font-weight: 700;
}

.header .db p:nth-of-type(2) span:nth-of-type(2) {
    font-size: 12px;
    color: #454555;
}

.header .db p:nth-of-type(2) span:nth-of-type(3) {
    font-size: 12px;
    margin-left: 3px;
    color: #0000FF;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px;
    margin-top: 15px;
    background: #fff;
    box-shadow: 0 0 8px rgb(0 25 141 / 12%);
    border-radius: 2px;
}

.container .content {
    width: 50%;
    flex-shrink: 0;
    padding: 10px;
    position: relative;
    box-sizing: border-box;
}
</style>